package com.atguigu.gmall.feign.cart;

import com.atguigu.gmall.cart.entity.CartInfo;
import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.product.entity.SkuInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Description
 * @Return
 * @Author https://weiranyi.github.io
 * @Date Created in 2022-12-16 17:58
 **/
@RequestMapping("/api/inner/rpc/cart")
@FeignClient("service-cart")
public interface CartFeignClient {
    @GetMapping("/add/{skuId}")
    Result<SkuInfo> addToCart(@PathVariable("skuId") Long skuId,
                              @RequestParam("skuNum") Integer num);

    @GetMapping("/del/checked")
    public Result delChecked();

    /**
     * 得到购物车选中的商品
     *
     * @return
     */
    @GetMapping("/checked/infos")
    public Result<List<CartInfo>> getCheckedCartInfo();

    @PostMapping("/delete/skuIds")
    public Result deleteSkuIds(@RequestBody List<Long> skuIds);
}
